<template>
  <div class="Vector">
    <div class="content">
      <div id="vectortable">
        <template>
          <el-table
            :data="theTextDataInfo"
            border
            :stripe="true"
            style="width: 100%"
            height="100%"
            :row-style="{height:120+'px'}"
            @selection-change="handleSelectionChange">
            <el-table-column
              prop="division"
              label="地州/师"
              width="100">
            </el-table-column>
            <el-table-column
              prop="regionName"
              label="区域名称"
              width="150">
            </el-table-column>
            <el-table-column
              prop="codeSet"
              header-align="codeSet"
              label="区域环境管控单元编码集"
              width="280">
            </el-table-column>
            <el-table-column
              header-align="spaceRestrain"
              prop="spaceRestrain"
              label="空间布局约束"
              width="240">
            </el-table-column>
            <el-table-column
              header-align="pollutantRestrain"
              prop="pollutantRestrain"
              label="污染物排放管控"
              width="240">
            </el-table-column>
              <el-table-column
                header-align="environmentRestrain"
                prop="environmentRestrain"
                label="环境风险防控"
                width="240">
            </el-table-column>
              <el-table-column
                fixed="right"
                header-align="resourceUtilization"
                prop="resourceUtilization"
                label="资源开发效率要求"
                >
              </el-table-column>
          </el-table>
        </template>
        <div class="block">
          <el-pagination
            @size-change="handleSizeChange"
            @current-change="handleCurrentChange"
            :current-page="currentPage1"
            :page-sizes="[15,20,30,50]"
            :page-size="15"
            layout="total, sizes, prev, pager, next, jumper"
            :total=theTextDataInfoTotal>
          </el-pagination>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
  import {createNamespacedHelpers} from 'vuex'
  const {mapGetters} = createNamespacedHelpers('dirmanage')
  export default {
    name: "TheArea",
    data() {
      return {
        xlname : '环境管控单元成果清单.xls',
        currentPage1: 1,
        requestParams:{
          pageNumber:1,
          pageSize:15,
          code:'',
          city:'',
          county:''
        },
        theTextDataInfo:[],
        theTextDataInfoTotal:15,
        json_fields:{
           '序号':'id',
           '环境管控单元编码':'unitCode',
           '环境管控单元名称':'unitName',
           '师级行政单位':"division",
           '县级行政单位':"regiment",
           '环境管控单元类型':'unitClassify',
           '空间布局约束':'spaceRestrain',
           '污染物排放管控':'pollutantRestrain',
           '环境风险防控':'environmentRestrain',
           '资源开发效率':'resourceUtilization',
        },
      };

    },
    computed:{
    },
    created(){
      this.getArea()
    },
    mounted() {

    },
    methods: {
      async getArea(){
        const {data:result}= await this.$http.get('/v1.0/resultIntegration/rule/environmentWholeRule/findPages?pageNumber='+this.requestParams.pageNumber+'&pageSize='+this.requestParams.pageSize)
       if(result.status=='3000'){
         this.theTextDataInfo=result.data.result;
       }

      },

      handleSizeChange(val) {
        console.log(`每页 ${val} 条`);
        this.requestParams.pageSize = val
        this.$store.dispatch('dirmanage/getTextData',this.requestParams)
      },
      handleCurrentChange(val) {
        this.requestParams.pageNumber = val
        this.$store.dispatch('dirmanage/getTextData',this.requestParams)
      },
      handleSelectionChange(val) {
        console.log(val)
        this.selectData = val
      },
      handleClick(row) {
        console.log(row);
      },
      handleEdit(index, row) {
        console.log(index, row);
      },
      handleDelete(index, row) {
        console.log(index, row);
      },
    }
  }
</script>

<style scoped lang="scss">
::v-deep .el-link.el-link--info:hover{
    color: #fff;
}
::v-deep .el-link.el-link--info{
    color: #606266
}
  .block{
    /*position: absolute;*/
    /*top: 90%;*/
    //padding-top: 10px;
  }
  ::v-deep .el-table td{
    padding: 12px 0 ;
  }
  .Vector{
    position: absolute;
    left: 15.5%;
    //height: 87%;
    top: 9.5%;
    bottom: 1.5%;
    width: 83.5%;
    /*background-color: #ffffff;*/
    border-radius: 8px;
  }
  .dir{
    position: absolute;
    width: 25%;
    height:100%;
    background-color: white;
    border-left:2px #E9EEF3 solid ;
    /*overflow: auto;*/
    border-radius: 8px;
    box-shadow: 0 0 5px #acc4fe;
  }
  .searchBar{
  ::v-deep .el-input__inner{
    border-radius: 45px;
  }
  }

  .content{
    //left:25.5%;
    position: absolute;
    height: 100%;
    width:100%;
    overflow: auto;
    background-color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 0 5px #acc4fe;
  }
  .broad{
    position: absolute;
    width: 98%;
    display: inline-block;
    padding: 1%;
    color: black;
    font-size: 20px;
    border-bottom: 2px solid #e9eef3;
    background-color: #ffffff;
    border-radius: 8px 8px 0 0 ;
  }
  ::v-deep .el-breadcrumb{
    font-size: 16px;
    font-family: sans-serif;
  }
  #vectortable{
    position: absolute;
    top: 10px;
    width: 98%;
    padding: 1%;
    height: calc(100% - 8%);
  }
  .el-input{
    width: 15%!important;
  }
  .demo-input-suffix{
    position: absolute;
    top: 10px;
    background-color: #ffffff;
    padding: 10px;

  }
  #datamove{
    display: inline-block;
  }
  .searchBar{
    display: inline-block;
    //margin-left: 80px;
    ::v-deep .el-button:focus, .el-button:hover {
      color: #fff;
      border-color: #c6e2ff;
      background: -webkit-linear-gradient(left,#3ee8c2,#25e4a3);
    }
    ::v-deep .el-button--goon:active {
      color: #fff;
      border-color: #c6e2ff;
      outline: 0;
    }
  }
  .searchBar > span{
    padding: 10px;
    font-size: 14px;
  }
  .margin_left{
    margin-left: 20px;
  }
  .el-button{
    margin-left: 20px;
    font-size: 14px!important;
  }
  ::v-deep .cell{
    text-align: center;
  }
::v-deep .el-table__empty-text{
  line-height:44px
}
::v-deep .el-table__empty-block{
  min-height: 44px;
}

::v-deep .el-table__body-wrapper {
  /*height: 200px; !* 滚动条整体高 必须项 *!*/
  border-right: none;
  overflow-y: scroll;/* overflow-y为了不出现水平滚动条*/
}
::v-deep .el-dialog--center .el-dialog__body{
  padding: 10px;
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar {
  width:6px;/* 滚动条的宽高 必须项 */
  height: 5px;
}
::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
  background-color: #bfcbd9;/* 滚动条的宽 */
  border-radius: 3px;
}
::v-deep .cell{
  max-height: 150px;
  overflow-y: auto;
}
::v-deep .cell::-webkit-scrollbar {
  width:6px;/* 滚动条的宽高 必须项 */
}
::v-deep .cell::-webkit-scrollbar-thumb {
  background-color: #bfcbd9;/* 滚动条的宽 */
  border-radius: 3px;
}

</style>
